package com.leyou.test1.demo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Demo7 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
       /* list.add("2019-12-02");
        list.add("2019-01-01");
        list.add("2019-02-01");
        list.add("2019-02-02");*/
       list.add("执行成功");
       list.add("执行失败");
        Collections.sort(list, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                //倒序
                return o2.compareTo(o1);
            }
        });
        for (String s : list) {
            System.out.println(s);
        }
       /* HashSet h = new HashSet(list);
        Iterator iterator = h.iterator();
        while (iterator.hasNext()){
            String next = (String)iterator.next();
            System.out.println(next);
        }*/
      /* List<String> list2= new ArrayList();
        list2.add("ddd");
        list2.add("fff");
        list.addAll(list2);
        for (String s : list) {
            System.out.println(s);

        }*/
    }
}
